package cn.neo.support.loopview;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.view.View;

import com.facebook.drawee.view.SimpleDraweeView;

import cn.neo.support.iv.fresco.XFresco;
import cn.neo.support.loopview.internal.BaseLoopAdapter;
import cn.neo.support.loopview.internal.LoopData;

/**
 * 版权所有：XXX有限公司
 * <p>
 * AdLoopAdapter
 *
 * @author zhou.wenkai ,Created on 2015-5-19 22:28:29
 *         Major Function：<b>一般数据适配器</b>
 *         <p>
 *         注:如果您修改了本类请填写以下内容作为记录，如非本人操作劳烦通知，谢谢！！！
 * @author mender，Modified Date Modify Content:
 */
public class AdLoopAdapter extends BaseLoopAdapter {

    public AdLoopAdapter(Context context, LoopData loopData,
                         ViewPager viewPager) {
        super(context, loopData, viewPager);
    }

    /**
     * 控件操作
     *
     * @param imageUrl
     */
    public View instantiateItemView(String imageUrl, int position) {
        //使用Fresco加载图片
        SimpleDraweeView simpleDraweeView = new SimpleDraweeView(mContext);
        XFresco.with(simpleDraweeView)
                .setAspectRatio(2.5f)
                .load(imageUrl);
        return simpleDraweeView;
    }

}